package com.slz3.business.module.systemManagement.sysOrganize.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.systemManagement.sysOrganize.domain.SysOrganize;
import com.slz3.business.module.systemManagement.sysOrganize.domain.SysOrganizeCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysOrganizeResController {

    static Mono<ServerResponse> add(ServerRequest req, SysOrganize sysOrganize) {
        if (SysOrganizeResUnsafeValid.add(req, sysOrganize)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResAtomic.add_$SysOrganizeUpdateLock(req, sysOrganize);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        if (SysOrganizeResUnsafeValid.delete(req, sysOrganizeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResAtomic.delete_$SysOrganizeUpdateLock(req, sysOrganizeCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, SysOrganize sysOrganize) {
        if (SysOrganizeResUnsafeValid.modify(req, sysOrganize)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResAtomic.modify_$SysOrganizeUpdateLock(req, sysOrganize);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (SysOrganizeResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (SysOrganizeResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResAtomic.info_$SysOrganizeUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (SysOrganizeResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        //
        if (SysOrganizeResUnsafeValid.auditSubmit(req, sysOrganizeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResAtomic.auditSubmit_$SysOrganizeUpdateLock(req, sysOrganizeCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        if (SysOrganizeResUnsafeValid.audit(req, sysOrganizeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResAtomic.audit_$SysOrganizeUpdateLock(req, sysOrganizeCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        if (SysOrganizeResUnsafeValid.auditReject(req, sysOrganizeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResAtomic.auditReject_$SysOrganizeUpdateLock(req, sysOrganizeCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        if (SysOrganizeResUnsafeValid.usingEnable(req, sysOrganizeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResAtomic.usingEnable_$SysOrganizeUpdateLock(req, sysOrganizeCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, SysOrganizeCondition sysOrganizeCondition) {
        if (SysOrganizeResUnsafeValid.usingDisable(req, sysOrganizeCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return SysOrganizeResAtomic.usingDisable_$SysOrganizeUpdateLock(req, sysOrganizeCondition);
        }
    }

}
